package com.lsj.core.exception;

import com.lsj.core.constant.exception.ExceptionEnum;
import lombok.Data;

/**
*@Author: lin.shj
*@Description: 用于处理可以预料到的异常，例如添加、查找、删除、更新失败等异常
*/
@Data
public class CustomerException  extends RuntimeException{
    private Integer code;
    private String method;

    public CustomerException(ExceptionEnum exceptionEnum, String method){
        super(exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
        this.method = method;
    }

    public CustomerException(Integer code,String msg,String method){
        super(msg);
        this.code = code;
        this.method = method;
    }
}
